package cn.tedu._10vehicle.controller;

import cn.tedu._10vehicle.base.response.JsonResult;
import cn.tedu._10vehicle.mapper.NoticeMapper;
import cn.tedu._10vehicle.pojo.vo.NoticeListVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "03-公告管理模块")
@Slf4j
@RestController
@RequestMapping("/v1/notice/")
public class NoticeController {
    @Autowired
    private NoticeMapper noticeMapper;
    /**
     * 首页公告展示
     */
    @GetMapping("list")
    @Operation(summary = "首页公告")
    public JsonResult list() {
        List<NoticeListVO> noticeListVOList = noticeMapper.selectNoticeList();
        return JsonResult.ok(noticeListVOList);
    }
}
